* {
    margin: 0;
    padding: 0;
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #e6f1f9;
}

.navbar {
    position: relative;
    width: 100vm;
    height: 100px;
    background-color: #e6f1f9;
    box-shadow: 0 10px 50px #c6d9ed;
}

.navbar input {
    display: none;
}

.navbar label {
    position: absolute;
    top: calc(50% - 25px);
    right: 50px;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    border: 1px solid rgba(198, 217, 237, .3);
    background-color: #e6f1f9;
    /* 盒子阴影，多组值用逗号隔开 */
    box-shadow: 5px 3px 6px 1px #c6d9ed, -5px -3px 6px 1px #fff;
    cursor: pointer;
    transition: all .5s ease-out;
}

/* 定义 label 的两条线 */
.navbar label::before,
.navbar label::after {
    content: "";
    position: absolute;
    left: 5px;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background-color: #042a41;
    /* 收回来的动画刚好相反 */
    transition: transform .3s ease-out, top .3s ease-out .3s;
}
.navbar label::before {
    top: calc(50% + 6px);
}
.navbar label::after {
    top: calc(50% - 10px);
}

/* 定义 label 元素的动画效果 */
.navbar input:checked + label {
    box-shadow: 0 0 0 #fff, 0 0 0 #fff, 5px 3px 6px 1px #c6d9ed inset, -5px -3px 6px 1px #fff inset;
}
.navbar input:checked + label::before {
    top: calc(50% - 2px);
    transform: rotate(-45deg);
    transition: top .3s ease-out, transform .3s ease-out .3s;
}
.navbar input:checked + label::after {
    top: calc(50% - 2px);
    transform: rotate(45deg);
    /* 设置过渡 */
    transition: top .3s ease-out, transform .3s ease-out .3s;
}

/* 移动端导航栏样式 start */
.navbar ul {
    position: relative;
    top: 100px;
    width: 100%;
    opacity: 0;
    transform: scaleY(0);
    transform-origin: 50% 0;
    transition: all .5s ease-out;
}

.navbar ul li {
    width: 100%;
    height: 66px;
}

.navbar ul li a {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 66px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    color: #042a41;
    box-shadow: 0 15px 20px #c6d9ed;
    transition: all .3s ease-out;
}
.navbar ul li a:hover {
    box-shadow: 0 0 0 #fff, 0 15px 20px #c6d9ed inset;
}

.navbar input:checked ~ ul {
    opacity: 1;
    transform: scaleY(1);
}
/* 移动端导航栏样式 end */

/* pc端导航栏样式 start */
@media (min-width: 992px) {
    .navbar label {
        display: none;
    }
    .navbar ul {
        /* static：让元素到原来的定位属性，相当于取消了定位 */
        position: static;
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 1200px;
        height: 100%;
        margin: 0 auto;
        opacity: 1;
        transform: scaleY(1);
    }
    .navbar ul li {
        list-style: none;
        text-align: center;
    }
    .navbar ul li a {
        display: inline;
        padding: 20px 40px;
        border-radius: 60px;
        box-shadow: 5px 3px 6px 1px #c6d9ed, -5px -3px 6px 1px #fff;
    }
    .navbar ul li a:hover {
        box-shadow: 0 0 0 #fff, 0 0 0 #fff, 5px 3px 6px 1px #c6d9ed inset;
    }
}
/* pc端导航栏样式 end */
